home *** CD-ROM | disk | FTP | other *** search
- Path: cypher.3do.com!user
- From: tsw@3do.com (Tom Watson)
- Newsgroups: comp.lang.c
- Subject: Re: Character String --> Integer
- Date: Wed, 07 Feb 1996 18:58:33 -0800
- Organization: The 3DO Corporation
- Distribution: world
- Message-ID: <tsw-0702961858330001@cypher.3do.com>
- References: <4fb0ga$lsa@remus.rutgers.edu>
- NNTP-Posting-Host: cypher.3do.com
-
- In article <4fb0ga$lsa@remus.rutgers.edu>, wempa@remus.rutgers.edu (Force
- Of Nature) wrote:
-
- > Is there an easy way to convert a character string such as '2425' to the
- > integer 2425 ??? The only way I can think of is to pick off characters
- > one at a time and use switch statements to determine the value (0-9) and
- > then multiply by the correct power of 10. Is there an easier way to do
- > this ???????
- >
- >
-
- Try the routine 'atoi' or its friends:
- 'strtol', 'fscanf', or 'atol'
-
- See your fine manual for more on these items.
-
- --
- Tom Watson
- tsw@3do.com (Home: tsw@johana.com)
-